package com.heima.kafka.consumer;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @Author Lijx
 * @Date 2024-07-29 10:24
 */
@Component
@Slf4j
public class KafkaConsumer {

    @KafkaListener(topics = "topic-itcast")
    public void consumer(ConsumerRecord record){
        log.info("接收到消息:{}",record);
    }
}
